/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import entity.xml.EMessaggio;
import foundation.FMessaggi;
import java.awt.Dimension;
import presentation.proportional.gui;

/**
 *
 * @author Quirino
 */
public class CVisualizzaMessaggio {
    
    private static CVisualizzaMessaggio instance= null;
    
    private CVisualizzaMessaggio(){}
    
    public static CVisualizzaMessaggio getInstance(){
        
        if(instance==null) instance= new CVisualizzaMessaggio();
        return instance;
        
    }
    
    public Dimension getDimensionFoglio(double coeffX, double coeffY){
        
        Dimension d= new Dimension();
        
        int w= Math.round((float) (this.getDimensionBacheca().width/coeffX));
        int h= Math.round((float) (this.getDimensionBacheca().height/coeffY));
        
        d.setSize(w, h);
        
        return d; 
        
    }
    
    public Dimension getDimensionBacheca(){
        
        Dimension d= new Dimension();
        
        int widthPanelBacheca= gui.getIstance().getPanelBachecaContainer().getWidth();
        int heightPanelBacheca= gui.getIstance().getPanelBachecaContainer().getHeight();
        
        d.setSize(widthPanelBacheca, heightPanelBacheca);
        
        return d;
        
    }
    
    public void changeStatoMsg( EMessaggio mess ){
        
        FMessaggi.getIstance().changeStatoByMsg(mess);
        
    }
    
}
